/**
 * 项目名称: Topic_1768.cpp
 * 项目路径: study/DataStructure/刷题/一轮/第八天 数组+指针
 * 编辑时间: 2024年09月09日20时31分55秒
 * 用   户: 轻尘
 */

#include <bits/stdc++.h>

using namespace std;

class Solution {
public:
    string mergeAlternately(string word1, string word2) {
        int minL = min(word1.size(),word2.size());
        string ans = "";
        for(int i = 0;i<minL;i++){
            ans+=word1[i];
            ans+=word2[i];
        }
        if(word1.size()>minL)ans+=word1.substr(minL);
        if(word2.size()>minL)ans+=word2.substr(minL);
        return ans;
    }
};
